// TOWN SCRIPT
//    Town 2: War Camp

// This is the special encounter script for this town.
// The states INIT_STATE, EXIT_STATE, and START_STATE have
// meanings that are described in the documenation. States you write
// yourself should be numbered from 10-100.

begintownscript;

variables;

int i,j,k,lvl,choice;

body;

beginstate INIT_STATE;
// This state called whenever this town is entered.
//Names
	set_name(6,"Captain Terronez");
	set_name(8,"Thomas");
	set_name(9,"Gerald");
	set_name(10,"Molly");
	set_char_dialogue_pic(10,1975,0);
	set_name(11,"Mrs. Hamilton");
	set_name(12,"Andrew");
	set_name(13,"Alvord");
	set_name(14,"Brian");
	set_name(15,"Grasmuck");
	set_name(16,"Mrs. Rivas");
	set_name(17,"Mrs. Anderson");
	set_name(18,"Kyle");
	set_name(25,"Bigga");

	if (get_flag(101,3) == 1) {
		activate_hidden_group(1);
		set_name(21,"Captain Baker");
		set_name(22,"Jeff");
	}

	set_crime_tolerance(5);

break;

beginstate EXIT_STATE;
// Always called when the town is left.
break;

beginstate START_STATE;

	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(8,"Urr...");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(12,"So did you hear about Winton...?");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(13,"*snicker*");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(15,"*chuckle*");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(18,"Hahaha!");

break;

beginstate 10;
	if (get_flag(105,0) == 1) && (get_flag(1,29) == 1) {
		if (get_flag(0,2) == 0) {
			reset_dialog_preset_options(0);
			add_dialog_str(0,"You peek into this room to see a solitary figure sitting at a desk. Upon a closer look, you can tell that it's Brian, the soldier you met briefly in Poulan. Perhaps he has time to talk now.",0);
			choice = run_dialog(0);
			if (choice == 1)
				set_flag(0,2,1);
		}
	}
break;